﻿CREATE TABLE [dbo].[DomiciliosClientes] (
    [IdDomicilioCliente] INT          IDENTITY (1, 1) NOT NULL,
    [IdCliente]          INT          NOT NULL,
    [IdTipoDomicilio]    TINYINT      NOT NULL,
    [IdBarrio]           INT          NOT NULL,
    [Calle]              VARCHAR (50) NOT NULL,
    [Numero]             VARCHAR (5)  NOT NULL,
    [Piso]               VARCHAR (2)  NOT NULL,
    [Departamento]       VARCHAR (2)  NOT NULL,
    CONSTRAINT [PK_DomiciliosClientes] PRIMARY KEY CLUSTERED ([IdDomicilioCliente] ASC),
    CONSTRAINT [FK_DomiciliosClientes_Barrios] FOREIGN KEY ([IdBarrio]) REFERENCES [dbo].[Barrios] ([IdBarrio]),
    CONSTRAINT [FK_DomiciliosClientes_Clientes] FOREIGN KEY ([IdCliente]) REFERENCES [dbo].[Clientes] ([IdCliente]),
    CONSTRAINT [FK_DomiciliosClientes_TiposDomicilios] FOREIGN KEY ([IdTipoDomicilio]) REFERENCES [dbo].[TiposDomicilios] ([IdTipoDomicilio])
);

